export function uniqueArray(arr): any[] {
    var set = new Set(arr);
    return Array.from(set);
}

export function intersectionArray(a: any[], b: any[]) {
    if (!Array.isArray(a) || !Array.isArray(b)) return [];
    return a.filter(function (v) { return b.indexOf(v) > -1 });
}

export function differenceArray(a: any[], b: any[]) {
    return a.filter(function (v) { return !(b.indexOf(v) > -1) }).concat(b.filter(function (v) { return !(a.indexOf(v) > -1) }));
}